#include "autofocusform.h"
#include "ui_autofocusform.h"
#include <QPainter>
#include <QStyleOption>

AutoFocusForm::AutoFocusForm(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::AutoFocusForm)
{
    ui->setupUi(this);
    this->setProperty("form","backgroundform");
    this->setFixedHeight(300);
    ui->leftBorderForm->SetLabelIcon("autoFocus");
}

AutoFocusForm::~AutoFocusForm()
{
    delete ui;
}

void AutoFocusForm::UpdateShowType(int type)
{
    ui->leftBorderForm->UpdateShowType(type);
}

void AutoFocusForm::paintEvent(QPaintEvent *event)
{
    QStyleOption opt;
    opt.init(this);
    QPainter painter(this);
    style()->drawPrimitive(QStyle::PE_Widget,&opt,&painter,this);
    QWidget::paintEvent(event);
}

void AutoFocusForm::on_toolButton_contractExpand_clicked(bool checked)
{
    ui->widget_hide->setHidden(!checked);
    if(checked)
        this->setFixedHeight(300);
    else
        this->setFixedHeight(70);
}
